The mental health of university students is an area of increasing concern worldwide. Although some recent studies revealed a high prevalence of depression and anxiety among Bangladeshi university students, no study has yet investigated the link between marriage pressure and these common psychological disorders and their effects on career and goal setup. Therefore, aims of these study is-
library(readxl)
data <- read_excel("F:/Fiverr/up-work project/dataset/project 68.xlsx")
tbl<- knitr::kable(table(data$MarriagePressure),col.names = c("Marriage Pressure", "Count"), "simple")
tbl
| Marriage Pressure | Count |
|---|---|
| no | 587 |
| yes | 349 |
library(plotly)
fig <- plot_ly(data, labels = ~MarriagePressure, values = ~frequency(MarriagePressure), type = 'pie')
fig <- fig %>% layout(title = 'Marriage Pressure of Female Students',
xaxis = list(showgrid = FALSE, zeroline = FALSE, showticklabels = FALSE),
yaxis = list(showgrid = FALSE, zeroline = FALSE, showticklabels = FALSE),
width = "50%",
height = 450)
fig
A total of 936 participants responded to the survey. Of these, 587 participants answered “No” to the question about having marriage pressure, while 349 participants answered “Yes.”
The results of the survey indicate that the majority of participants 62.7% answered “No” to the question about having marriage pressure. Only 37.3% participants answered “Yes.” This data suggests that a larger proportion of the participants did not experience marriage pressure, while a smaller proportion reported that they did. The pie chart provides a clear and straightforward representation of the distribution of responses and highlights the differences between the two categories.
When we look after another variable PHQ-9 (Patient Health Question) the scores were then analyzed to categorize the students into different levels of depression severity, including normal depression, mild depression, moderate depression, moderately severe depression, and severe depression.
phq_categories<- ifelse(data$phq9 <= 4, "Normal",
ifelse(data$phq9 <= 9, "Mild",
ifelse(data$phq9 <= 14,"Moderate",
ifelse(data$phq9 <= 19, "Moderately Severe",
ifelse(data$phq9 <=27,"Severe",data$phq9)))))
phq_categories <- table(phq_categories)
phq_categories_df <- as.data.frame(phq_categories, stringsAsFactors = FALSE)
colnames(phq_categories_df) <- c("Depression Severity", "Frequency")
knitr::kable(phq_categories_df, col.names = c("Depression Severity", "Frequency"), "simple")
| Depression Severity | Frequency |
|---|---|
| Mild | 248 |
| Moderate | 224 |
| Moderately Severe | 136 |
| Normal | 272 |
| Severe | 56 |
library(plotly)
fig <- plot_ly(phq_categories_df, x = ~`Depression Severity`, y = ~Frequency, type = "bar", color = ~`Depression Severity`) %>%
layout(title = "Depression Severity Categories", xaxis = list(title = "Category"), yaxis = list(title = "Frequency"))
fig
tt<-rbind(
nrow(data[data$Year == '1st' & data$MarriagePressure == 'yes', ]),
nrow(data[data$Year == '2nd' & data$MarriagePressure == 'yes', ]),
nrow(data[data$Year == '3rd' & data$MarriagePressure == 'yes', ]),
nrow(data[data$Year == '4th' & data$MarriagePressure == 'yes' , ]),
nrow(data[data$Year == 'masters' & data$MarriagePressure == 'yes', ])
)
academic_yr <- matrix(c('1st','2nd','3rd','4th','masters'), ncol=1)
table_aca<- cbind(academic_yr,tt)
table_aca_df <- as.data.frame(table_aca, stringsAsFactors = FALSE)
# Rename the columns
colnames(table_aca_df) <- c("Academic Year", "Marriage Pressure(yes)")
total_stu<- data.frame(table(data$Year))
colnames(total_stu) <- c("Academic Year", "Marriage Pressure(yes)")
# Merge the two data frames by the "Academic Year" column
merged_df <- merge(table_aca_df, total_stu, by = 'Academic Year' )
knitr::kable(merged_df, col.names = c("Academic Year", "Marriage pressure(yes)", "Total Student"), "simple")
| Academic Year | Marriage pressure(yes) | Total Student |
|---|---|---|
| 1st | 141 | 215 |
| 2nd | 27 | 227 |
| 3rd | 78 | 350 |
| 4th | 80 | 96 |
| masters | 23 | 48 |
The given survey data contains information about the academic year, marriage pressure, and total number of students. Using this data, we created a frequency table and a clustered bar chart to visualize the relationship between academic year, marriage pressure, and total number of students. We also created an interactive stacked bar chart to allow for further exploration of the data.
# Create the bar chart
library(plotly)
plot_ly(merged_df, x = ~merged_df$`Academic Year`, y = ~`Marriage Pressure(yes).x`, name = "Marriage Pressure",
type = "bar", marker = list(color = "#F8766D")) %>%
add_trace(y = ~`Marriage Pressure(yes).y`, name = "Total Students",
marker = list(color = "#00BFC4")) %>%
layout(title = "Marriage Pressure vs Total Students by Academic Year",
xaxis = list(title = "Academic Year"),
yaxis = list(title = "Frequency"),
barmode = "stack")
Overall, the analysis suggests that marriage pressure may have an impact on the academic decisions of students, with higher levels of marriage pressure being associated with fewer students in higher academic years.
library(dplyr)
df<- data %>%
select(phq9) %>%
mutate(phqcat =
ifelse(phq9 <= 4, 1,
ifelse(phq9 <= 9,2,
ifelse(phq9<= 14,3,
ifelse(phq9<= 19,4,
ifelse(phq9<= 27, 5, data$phq9)))))
)
data<- merge(data, df, by = 'phq9')
library(kableExtra)
# Execute Pearson's Chi-squared test
result <- chisq.test(data$MarriagePressure, data$phqcat)
# Create a table with the results
tbl <- data.frame(
"Test" = "Pearson's Chi-squared test",
"Variables" = "Marriage Pressure and phq9 Categories",
"X-squared" = round(result$statistic, 2),
"df" = result$parameter,
"p-value" = format.pval(result$p.value)
) %>%
kable(align = "c") %>%
kable_styling(full_width = FALSE)
# Print the table
tbl
| Test | Variables | X.squared | df | p.value | |
|---|---|---|---|---|---|
| X-squared | Pearson’s Chi-squared test | Marriage Pressure and phq9 Categories | 272.24 | 4 | < 2.22e-16 |